<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>CSS3 滚动捕获</title>
  <style>
    *{
        margin: 0;
        padding: 0;
    }
    ::-webkit-scrollbar{
        height: 10px;
        background-color: red;
    }
    ::-webkit-scrollbar-thumb{
        background-color: blueviolet;
    }
    .wapper{
        width: 500px;
        height: 150px;
        border: 5px solid black;
        overflow-x: scroll;
        scroll-snap-type: x mandatory;
    }
    .wapper ul{
        width: calc(300px * 5);
        height: 100%;
        list-style: none;
    }
    .wapper ul li {
        scroll-snap-align: start;
        width: 200px;
        margin: 0 50px;
        background-color: blue;
        height: 100%;
        float: left;
    }
  </style>
</head>
<body>
  <div class="wapper">
    <ul>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
    </ul>
  </div>
</body>
</html>